Rails.application.routes.draw do

  scope "(/:locale)" do

    devise_for :users

    resources :patient_insurances

    resources :insurance_companies

    resources :blood_types

    resource :calendar, only: [:show], controller: :calendar

    resources :stock_logging_categories

    resources :payment_methods

    resources :card_providers

    resources :payments

    resources :invoice_item_types

    resources :invoice_details

    resources :invoices do
      resources :invoice_details
      resources :invoice_item_types
      resources :payments
      resources :payment_methods
      resources :card_providers
    end

    resources :suppliers

    resources :stock_loggings

    resources :inventories

    resources :stocks

    resources :drugs do
      resources :manufacturers
      resources :suppliers
      resources :stocks
      resources :stock_loggings
      resources :prescriptions
      resources :drugs
      resources :inventories

    end

    resources :manufacturers

    resources :treatment_groups

    resources :treatments

    resources :prescriptions

    resources :diagnosis_groups

    resources :diagnoses

    resources :registration_methods

    resources :appointment_statuses

    resources :appointments do
      resources :diagnoses
      resources :treatments
      resources :prescriptions do
        resources :drugs
      end
      resources :diagnosis_groups
      resources :treatment_groups
      resources :drugs
    end

    resources :contact_types

    resources :contacts

    resources :patients do
      resources :contacts
      resources :contact_types
    end

    resources :staff_roles

    resources :staffs do
      resources :contacts
      resources :contact_types
      resources :staff_roles
    end

    root 'welcome#index'
  end
end
